<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>Example: Contextual Example</title>
    <link rel="stylesheet" href="http://yui.yahooapis.com/3.4.0pr3/build/cssgrids/grids-min.css">
    <link rel="stylesheet" href="../assets/css/main.css">
    <link rel="stylesheet" href="../assets/vendor/prettify/prettify-min.css">
    <script src="../../build/yui/yui-min.js"></script>
</head>
<body>

<div id="doc">
    <h1>Example: Contextual Example</h1>

    

    <div class="yui3-g">
        <div id="main" class="yui3-u">
            <div class="content"><div class="intro">
    <p>This example shows a page of HTML elements with CSS Reset and contextual CSS Fonts applied.</p>
</div>

<div class="example newwindow">
    <a href="cssfonts-context-example.html" target="_blank" class="button">
        View Example in New Window
    </a>
</div>

    <h2>Contextual Usage</h2>
    <p>When CSS Fonts is included in a page it applies rules to all HTML elements via type selectors like this: <code>body {font-size:13px;}</code>. An alternate version, <code>cssfonts-context.css</code>, uses only descendent selectors like this: <code>.yui3-cssfonts-context {font-size:13px;}</code>. This means you can put that class value on a node in your document to choose which region(s) of your page CSS Fonts will be applied to.</p>

<pre class="code prettyprint">&lt;div class=&quot;yui3-cssfonts&quot;&gt;
    &lt;p&gt;Everything within this container will have CSS Fonts applied.&lt;&#x2F;p&gt;
&lt;&#x2F;div&gt;</pre>


<p>In this example, only the middle block is within the context of CSS Fonts. The other two blocks are unaffected by CSS Fonts since their context is not one matched by the descendent selector of the contextual version of CSS Fonts.</p>

<h3>Note:</h3>
<p>Because CSS examples are susceptible to other CSS on the page, this example is only available in a new window at the above link.</p>


</div>
        </div>

        <div id="sidebar" class="yui3-u">
            

            
                <div class="sidebox">
                    <div class="hd">
                        <h2 class="no-toc">Examples</h2>
                    </div>

                    <div class="bd">
                        <ul class="examples">
                            
                                
                                    <li data-description="When CSS Fonts is included in a page, it applies a baseline font treatment to all HTML elements. This baseline is Arial at the equivalent of 13px size and 16px line-height.">
                                        <a href="cssfonts-basic.html">Global (Page-Level) Example</a>
                                    </li>
                                
                            
                                
                                    <li data-description="Use the alternate contextual version of YUI Fonts to have precise control over which regions of the page are targeted.">
                                        <a href="cssfonts-context.html">Contextual Example</a>
                                    </li>
                                
                            
                                
                                    <li data-description="Define all non-baseline sizes in percentages when using YUI Fonts.">
                                        <a href="cssfonts-size.html">Setting Font Size</a>
                                    </li>
                                
                            
                        </ul>
                    </div>
                </div>
            

            
        </div>
    </div>
</div>

<script src="../assets/vendor/prettify/prettify-min.js"></script>
<script>prettyPrint();</script>

</body>
</html>
